<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
    <title>处理申请</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <meta name="description" content="">

    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/weui/lib/weui.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/weui/css/jquery-weui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/weui/css/main.css">

</head>

<body ontouchstart>
<header class='demos-header'>
    <h1 class="demos-title" style="text-align: center">处理申请</h1>
</header>
<div class="weui-form-preview">
    <div class="weui-form-preview__hd">
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">审批状态</label>
            <c:if test="${record.reportResult=='1'}">
                <em class="weui-form-preview__value" style="color: green">审批通过</em>
            </c:if>
            <c:if test="${record.reportResult=='0'}">
                <em class="weui-form-preview__value" style="color: blue">待审批</em>
            </c:if>
            <c:if test="${record.reportResult=='-1'}">
                <em class="weui-form-preview__value" style="color: red">审批拒绝</em>
            </c:if>
        </div>
    </div>

    <div class="weui-form-preview__bd">
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">申请人</label>
            <span class="weui-form-preview__value">${record.drinkRole}${record.drinkPerson}</span>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">申请时间</label>
            <span class="weui-form-preview__value">
                  <fmt:formatDate value="${record.drinkApplyTime}"
                                  pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></span>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">饮酒地点</label>
            <span class="weui-form-preview__value">${record.drinkPlace}</span>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">饮酒时间</label>
            <span class="weui-form-preview__value">
            <fmt:formatDate value="${record.drinkStartTime}" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate>
            到<fmt:formatDate value="${record.drinkEndTime}" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate>
          </span>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">申请理由</label>
            <span class="weui-form-preview__value">${record.drinkReason}</span>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">紧急联系人</label>
            <span class="weui-form-preview__value">${record.emergencyPhone}</span>
        </div>
    </div>
    <br>

    <form id="form" action="${pageContext.request.contextPath}/apply/doDealApply.do">
        <input type="hidden" name="id" value="${record.id}">
        <div class="weui-cells__title">审核结果</div>
        <div class="weui-cells weui-cells_checkbox">
            <label class="weui-cell weui-check__label">
                <div class="weui-cell__hd">
                    <input type="radio" class="weui-check" name="reportResult" value="1">
                    <i class="weui-icon-checked"></i>
                </div>
                <div class="weui-cell__bd">
                    <p>同意</p>
                </div>

            </label>
        </div>
        <div class="weui-cells weui-cells_checkbox">
            <label class="weui-cell weui-check__label">
                <div class="weui-cell__hd">
                    <input type="radio" class="weui-check" name="reportResult"  value="-1" checked="checked">
                    <i class="weui-icon-checked"></i>
                </div>
                <div class="weui-cell__bd">
                    <p>不同意</p>
                </div>
            </label>
        </div>

        <div class="weui-cells__title">审批意见</div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <textarea class="weui-textarea" placeholder="请输入审批意见" rows="3" name="reportExplain" id="reportExplain"></textarea>
                </div>
            </div>
        </div>
    </form>

    <div class="weui-btn-area">
        <c:if test="${record.reportResult=='0'}">
            <a class="weui-btn weui-btn_primary" href="javascript:" id="save">保存审批结果和意见</a>
        </c:if>

    </div>
</div>

<script src="${pageContext.request.contextPath}/static/weui/lib/jquery-2.1.4.js"></script>
<script src="${pageContext.request.contextPath}/static/weui/lib/fastclick.js"></script>
<script>
    $(function () {
        FastClick.attach(document.body);
    });

    $("#save").click(function () {
        var reportExplain = $('#reportExplain').val();
        if (!reportExplain) {
            $.toptip('请输入审批意见');
            return;
        }
        $("#form").submit();
    });
</script>
<script src="${pageContext.request.contextPath}/static/weui/js/jquery-weui.js"></script>
</body>
</html>
